<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="icon" href="/favicon.ico">
    <title>待处理告警列表</title>
  </head>
  
  <!-- golang模板 https://www.cnblogs.com/Pynix/p/4154630.html -->

  <body> 
    <table border="1"  bordercolor="#ac8b8b" cellspacing="0" width="50%" style="border-collapse:collapse;" > 
        <caption><h2>待处理告警列表</h2></caption>
        <tr bgcolor="#979494" height=50px >
            <th>序号</th><th>告警主题</th>
        </tr>
        {{ range $key, $value := .}}
        <tr height=40px>
            <td bgcolor="#d1d1d1" align="center">{{ $key }}</td>
        
            {{ if eq $value.Priority  4 }}
            <td bgcolor="#e97558">{{  $value.Description }}</td>
            {{ end }}

            {{ if eq $value.Priority  3 }}
            <td bgcolor="#f9a059">{{  $value.Description }}</td>
            {{ end }}

            {{ if eq $value.Priority  2 }}
            <td bgcolor="#fcc859">{{  $value.Description }}</td>
            {{ end }}
        </tr>
       {{end}}
  </body>
</html>